<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>PubMed文献检索</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .container { max-width: 800px; margin-top: 50px; }
        .search-form { background-color: #f8f9fa; padding: 30px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
        .error-message { color: #dc3545; margin-top: 15px; }
    </style>
</head>
<body>
    <div class="container">
        <div class="search-form">
            <h2 class="mb-4 text-center">PubMed文献检索</h2>
            <form th:action="@{/search}" method="get">
                <div class="mb-3">
                    <label for="query" class="form-label">检索词</label>
                    <input type="text" class="form-control" id="query" name="query" required
                           placeholder="请输入关键词，如：machine learning diabetes">
                </div>
                <button type="submit" class="btn btn-primary w-100">检索文献</button>
                <div th:if="${error}" class="error-message text-center" th:text="${error}"></div>
            </form>
        </div>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>